package com.google.gson.internal.bind;

import com.google.gson.b.a;
import com.google.gson.b.c;
import com.google.gson.b.d;
import java.io.IOException;

final class z extends TypeAdapter {
    private final Class a;

    public z(Class cls) {
        this.a = cls;
    }

    public Enum a(a aVar) throws IOException {
        if (aVar.f() != c.NULL) {
            return Enum.valueOf(this.a, aVar.h());
        }
        aVar.j();
        return null;
    }

    public void a(d dVar, Enum enumR) throws IOException {
        dVar.b(enumR == null ? null : enumR.name());
    }

    public /* synthetic */ Object b(a aVar) throws IOException {
        return a(aVar);
    }
}
